{
    "cells": [
        {
            "cell_type": "code",
            "execution_count": 11,
            "source": [
                "import akshare as ak\r\n",
                "ak.stock_zh_a_spot()"
            ],
            "outputs": [
                {
                    "output_type": "stream",
                    "name": "stderr",
                    "text": []
                },
                {
                    "output_type": "execute_result",
                    "data": {
                        "text/plain": [
                            "            代码    名称    最新价   涨跌额     涨跌幅     买入     卖出     昨收     今开     最高  \\\n",
                            "0     sh600000  浦发银行   9.08  0.03   0.331   9.07   9.08   9.05   9.05   9.08   \n",
                            "1     sh600004  白云机场   8.41 -0.13  -1.522   8.41   8.42   8.54   8.59   8.60   \n",
                            "2     sh600006  东风汽车   8.66  0.03   0.348   8.65   8.66   8.63   8.70   8.84   \n",
                            "3     sh600007  中国国贸  15.30 -0.01  -0.065  15.30  15.31  15.31  15.33  15.46   \n",
                            "4     sh600008  首创环保   3.30  0.06   1.852   3.29   3.30   3.24   3.25   3.32   \n",
                            "...        ...   ...    ...   ...     ...    ...    ...    ...    ...    ...   \n",
                            "4421  sz301037   保立佳  27.58 -0.17  -0.613  27.58  27.59  27.75  28.17  29.40   \n",
                            "4422  sz301038   C深水  21.50 -3.06 -12.459  21.50  21.51  24.56  22.31  23.25   \n",
                            "4423  sz301039  中集车辆  11.34 -0.47  -3.980  11.34  11.35  11.81  11.81  11.98   \n",
                            "4424  sz301040   C中环  40.43  1.33   3.402  40.43  40.44  39.10  37.83  42.00   \n",
                            "4425  sz301042   C安联  56.49 -9.21 -14.018  56.48  56.49  65.70  61.00  61.69   \n",
                            "\n",
                            "         最低          成交量          成交额  \n",
                            "0      9.00   22486126.0  203315738.0  \n",
                            "1      8.39   15962347.0  134611409.0  \n",
                            "2      8.51   83204753.0  721857623.0  \n",
                            "3     15.10    2349926.0   35813897.0  \n",
                            "4      3.22  122606675.0  402742126.0  \n",
                            "...     ...          ...          ...  \n",
                            "4421  27.58    6440723.0  183571816.0  \n",
                            "4422  21.05   14462493.0  316801660.0  \n",
                            "4423  11.29   19131633.0  221268962.0  \n",
                            "4424  37.15   10567991.0  416305554.0  \n",
                            "4425  56.46    5584817.0  325471545.0  \n",
                            "\n",
                            "[4426 rows x 13 columns]"
                        ],
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th>代码</th>\n",
                            "      <th>名称</th>\n",
                            "      <th>最新价</th>\n",
                            "      <th>涨跌额</th>\n",
                            "      <th>涨跌幅</th>\n",
                            "      <th>买入</th>\n",
                            "      <th>卖出</th>\n",
                            "      <th>昨收</th>\n",
                            "      <th>今开</th>\n",
                            "      <th>最高</th>\n",
                            "      <th>最低</th>\n",
                            "      <th>成交量</th>\n",
                            "      <th>成交额</th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th>0</th>\n",
                            "      <td>sh600000</td>\n",
                            "      <td>浦发银行</td>\n",
                            "      <td>9.08</td>\n",
                            "      <td>0.03</td>\n",
                            "      <td>0.331</td>\n",
                            "      <td>9.07</td>\n",
                            "      <td>9.08</td>\n",
                            "      <td>9.05</td>\n",
                            "      <td>9.05</td>\n",
                            "      <td>9.08</td>\n",
                            "      <td>9.00</td>\n",
                            "      <td>22486126.0</td>\n",
                            "      <td>203315738.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>sh600004</td>\n",
                            "      <td>白云机场</td>\n",
                            "      <td>8.41</td>\n",
                            "      <td>-0.13</td>\n",
                            "      <td>-1.522</td>\n",
                            "      <td>8.41</td>\n",
                            "      <td>8.42</td>\n",
                            "      <td>8.54</td>\n",
                            "      <td>8.59</td>\n",
                            "      <td>8.60</td>\n",
                            "      <td>8.39</td>\n",
                            "      <td>15962347.0</td>\n",
                            "      <td>134611409.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>sh600006</td>\n",
                            "      <td>东风汽车</td>\n",
                            "      <td>8.66</td>\n",
                            "      <td>0.03</td>\n",
                            "      <td>0.348</td>\n",
                            "      <td>8.65</td>\n",
                            "      <td>8.66</td>\n",
                            "      <td>8.63</td>\n",
                            "      <td>8.70</td>\n",
                            "      <td>8.84</td>\n",
                            "      <td>8.51</td>\n",
                            "      <td>83204753.0</td>\n",
                            "      <td>721857623.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>3</th>\n",
                            "      <td>sh600007</td>\n",
                            "      <td>中国国贸</td>\n",
                            "      <td>15.30</td>\n",
                            "      <td>-0.01</td>\n",
                            "      <td>-0.065</td>\n",
                            "      <td>15.30</td>\n",
                            "      <td>15.31</td>\n",
                            "      <td>15.31</td>\n",
                            "      <td>15.33</td>\n",
                            "      <td>15.46</td>\n",
                            "      <td>15.10</td>\n",
                            "      <td>2349926.0</td>\n",
                            "      <td>35813897.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>sh600008</td>\n",
                            "      <td>首创环保</td>\n",
                            "      <td>3.30</td>\n",
                            "      <td>0.06</td>\n",
                            "      <td>1.852</td>\n",
                            "      <td>3.29</td>\n",
                            "      <td>3.30</td>\n",
                            "      <td>3.24</td>\n",
                            "      <td>3.25</td>\n",
                            "      <td>3.32</td>\n",
                            "      <td>3.22</td>\n",
                            "      <td>122606675.0</td>\n",
                            "      <td>402742126.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>...</th>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4421</th>\n",
                            "      <td>sz301037</td>\n",
                            "      <td>保立佳</td>\n",
                            "      <td>27.58</td>\n",
                            "      <td>-0.17</td>\n",
                            "      <td>-0.613</td>\n",
                            "      <td>27.58</td>\n",
                            "      <td>27.59</td>\n",
                            "      <td>27.75</td>\n",
                            "      <td>28.17</td>\n",
                            "      <td>29.40</td>\n",
                            "      <td>27.58</td>\n",
                            "      <td>6440723.0</td>\n",
                            "      <td>183571816.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4422</th>\n",
                            "      <td>sz301038</td>\n",
                            "      <td>C深水</td>\n",
                            "      <td>21.50</td>\n",
                            "      <td>-3.06</td>\n",
                            "      <td>-12.459</td>\n",
                            "      <td>21.50</td>\n",
                            "      <td>21.51</td>\n",
                            "      <td>24.56</td>\n",
                            "      <td>22.31</td>\n",
                            "      <td>23.25</td>\n",
                            "      <td>21.05</td>\n",
                            "      <td>14462493.0</td>\n",
                            "      <td>316801660.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4423</th>\n",
                            "      <td>sz301039</td>\n",
                            "      <td>中集车辆</td>\n",
                            "      <td>11.34</td>\n",
                            "      <td>-0.47</td>\n",
                            "      <td>-3.980</td>\n",
                            "      <td>11.34</td>\n",
                            "      <td>11.35</td>\n",
                            "      <td>11.81</td>\n",
                            "      <td>11.81</td>\n",
                            "      <td>11.98</td>\n",
                            "      <td>11.29</td>\n",
                            "      <td>19131633.0</td>\n",
                            "      <td>221268962.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4424</th>\n",
                            "      <td>sz301040</td>\n",
                            "      <td>C中环</td>\n",
                            "      <td>40.43</td>\n",
                            "      <td>1.33</td>\n",
                            "      <td>3.402</td>\n",
                            "      <td>40.43</td>\n",
                            "      <td>40.44</td>\n",
                            "      <td>39.10</td>\n",
                            "      <td>37.83</td>\n",
                            "      <td>42.00</td>\n",
                            "      <td>37.15</td>\n",
                            "      <td>10567991.0</td>\n",
                            "      <td>416305554.0</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4425</th>\n",
                            "      <td>sz301042</td>\n",
                            "      <td>C安联</td>\n",
                            "      <td>56.49</td>\n",
                            "      <td>-9.21</td>\n",
                            "      <td>-14.018</td>\n",
                            "      <td>56.48</td>\n",
                            "      <td>56.49</td>\n",
                            "      <td>65.70</td>\n",
                            "      <td>61.00</td>\n",
                            "      <td>61.69</td>\n",
                            "      <td>56.46</td>\n",
                            "      <td>5584817.0</td>\n",
                            "      <td>325471545.0</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "<p>4426 rows × 13 columns</p>\n",
                            "</div>"
                        ]
                    },
                    "metadata": {},
                    "execution_count": 11
                }
            ],
            "metadata": {}
        },
        {
            "cell_type": "code",
            "execution_count": 12,
            "source": [
                "ak.stock_zh_a_hist('603777', start_date=\"20210301\", end_date=\"20210806\")"
            ],
            "outputs": [
                {
                    "output_type": "execute_result",
                    "data": {
                        "text/plain": [
                            "             日期     开盘     收盘     最高     最低    成交量         成交额    振幅   涨跌幅  \\\n",
                            "0    2021-03-01  10.43  10.64  10.67  10.41  16159  17006677.0  2.50  2.11   \n",
                            "1    2021-03-02  10.67  10.59  10.78  10.48  15925  16913185.0  2.82 -0.47   \n",
                            "2    2021-03-03  10.56  10.69  10.75  10.48  16641  17750328.0  2.55  0.94   \n",
                            "3    2021-03-04  10.62  10.63  10.80  10.54  17079  18219275.0  2.43 -0.56   \n",
                            "4    2021-03-05  10.60  11.25  11.42  10.55  50361  56074095.0  8.18  5.83   \n",
                            "..          ...    ...    ...    ...    ...    ...         ...   ...   ...   \n",
                            "105  2021-08-02  13.10  13.51  13.57  12.93  71016  94966820.0  4.88  3.05   \n",
                            "106  2021-08-03  13.40  13.42  13.75  13.23  57258  77472519.0  3.85 -0.67   \n",
                            "107  2021-08-04  13.37  13.45  13.59  13.30  44479  59663508.0  2.16  0.22   \n",
                            "108  2021-08-05  13.27  13.21  13.45  13.01  44542  58907476.0  3.27 -1.78   \n",
                            "109  2021-08-06  13.14  13.21  13.29  12.97  44368  58101714.0  2.42  0.00   \n",
                            "\n",
                            "      涨跌额   换手率  \n",
                            "0    0.22  0.48  \n",
                            "1   -0.05  0.47  \n",
                            "2    0.10  0.49  \n",
                            "3   -0.06  0.51  \n",
                            "4    0.62  1.50  \n",
                            "..    ...   ...  \n",
                            "105  0.40  2.11  \n",
                            "106 -0.09  1.70  \n",
                            "107  0.03  1.32  \n",
                            "108 -0.24  1.32  \n",
                            "109  0.00  1.32  \n",
                            "\n",
                            "[110 rows x 11 columns]"
                        ],
                        "text/html": [
                            "<div>\n",
                            "<style scoped>\n",
                            "    .dataframe tbody tr th:only-of-type {\n",
                            "        vertical-align: middle;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe tbody tr th {\n",
                            "        vertical-align: top;\n",
                            "    }\n",
                            "\n",
                            "    .dataframe thead th {\n",
                            "        text-align: right;\n",
                            "    }\n",
                            "</style>\n",
                            "<table border=\"1\" class=\"dataframe\">\n",
                            "  <thead>\n",
                            "    <tr style=\"text-align: right;\">\n",
                            "      <th></th>\n",
                            "      <th>日期</th>\n",
                            "      <th>开盘</th>\n",
                            "      <th>收盘</th>\n",
                            "      <th>最高</th>\n",
                            "      <th>最低</th>\n",
                            "      <th>成交量</th>\n",
                            "      <th>成交额</th>\n",
                            "      <th>振幅</th>\n",
                            "      <th>涨跌幅</th>\n",
                            "      <th>涨跌额</th>\n",
                            "      <th>换手率</th>\n",
                            "    </tr>\n",
                            "  </thead>\n",
                            "  <tbody>\n",
                            "    <tr>\n",
                            "      <th>0</th>\n",
                            "      <td>2021-03-01</td>\n",
                            "      <td>10.43</td>\n",
                            "      <td>10.64</td>\n",
                            "      <td>10.67</td>\n",
                            "      <td>10.41</td>\n",
                            "      <td>16159</td>\n",
                            "      <td>17006677.0</td>\n",
                            "      <td>2.50</td>\n",
                            "      <td>2.11</td>\n",
                            "      <td>0.22</td>\n",
                            "      <td>0.48</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>1</th>\n",
                            "      <td>2021-03-02</td>\n",
                            "      <td>10.67</td>\n",
                            "      <td>10.59</td>\n",
                            "      <td>10.78</td>\n",
                            "      <td>10.48</td>\n",
                            "      <td>15925</td>\n",
                            "      <td>16913185.0</td>\n",
                            "      <td>2.82</td>\n",
                            "      <td>-0.47</td>\n",
                            "      <td>-0.05</td>\n",
                            "      <td>0.47</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>2</th>\n",
                            "      <td>2021-03-03</td>\n",
                            "      <td>10.56</td>\n",
                            "      <td>10.69</td>\n",
                            "      <td>10.75</td>\n",
                            "      <td>10.48</td>\n",
                            "      <td>16641</td>\n",
                            "      <td>17750328.0</td>\n",
                            "      <td>2.55</td>\n",
                            "      <td>0.94</td>\n",
                            "      <td>0.10</td>\n",
                            "      <td>0.49</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>3</th>\n",
                            "      <td>2021-03-04</td>\n",
                            "      <td>10.62</td>\n",
                            "      <td>10.63</td>\n",
                            "      <td>10.80</td>\n",
                            "      <td>10.54</td>\n",
                            "      <td>17079</td>\n",
                            "      <td>18219275.0</td>\n",
                            "      <td>2.43</td>\n",
                            "      <td>-0.56</td>\n",
                            "      <td>-0.06</td>\n",
                            "      <td>0.51</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>4</th>\n",
                            "      <td>2021-03-05</td>\n",
                            "      <td>10.60</td>\n",
                            "      <td>11.25</td>\n",
                            "      <td>11.42</td>\n",
                            "      <td>10.55</td>\n",
                            "      <td>50361</td>\n",
                            "      <td>56074095.0</td>\n",
                            "      <td>8.18</td>\n",
                            "      <td>5.83</td>\n",
                            "      <td>0.62</td>\n",
                            "      <td>1.50</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>...</th>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "      <td>...</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>105</th>\n",
                            "      <td>2021-08-02</td>\n",
                            "      <td>13.10</td>\n",
                            "      <td>13.51</td>\n",
                            "      <td>13.57</td>\n",
                            "      <td>12.93</td>\n",
                            "      <td>71016</td>\n",
                            "      <td>94966820.0</td>\n",
                            "      <td>4.88</td>\n",
                            "      <td>3.05</td>\n",
                            "      <td>0.40</td>\n",
                            "      <td>2.11</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>106</th>\n",
                            "      <td>2021-08-03</td>\n",
                            "      <td>13.40</td>\n",
                            "      <td>13.42</td>\n",
                            "      <td>13.75</td>\n",
                            "      <td>13.23</td>\n",
                            "      <td>57258</td>\n",
                            "      <td>77472519.0</td>\n",
                            "      <td>3.85</td>\n",
                            "      <td>-0.67</td>\n",
                            "      <td>-0.09</td>\n",
                            "      <td>1.70</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>107</th>\n",
                            "      <td>2021-08-04</td>\n",
                            "      <td>13.37</td>\n",
                            "      <td>13.45</td>\n",
                            "      <td>13.59</td>\n",
                            "      <td>13.30</td>\n",
                            "      <td>44479</td>\n",
                            "      <td>59663508.0</td>\n",
                            "      <td>2.16</td>\n",
                            "      <td>0.22</td>\n",
                            "      <td>0.03</td>\n",
                            "      <td>1.32</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>108</th>\n",
                            "      <td>2021-08-05</td>\n",
                            "      <td>13.27</td>\n",
                            "      <td>13.21</td>\n",
                            "      <td>13.45</td>\n",
                            "      <td>13.01</td>\n",
                            "      <td>44542</td>\n",
                            "      <td>58907476.0</td>\n",
                            "      <td>3.27</td>\n",
                            "      <td>-1.78</td>\n",
                            "      <td>-0.24</td>\n",
                            "      <td>1.32</td>\n",
                            "    </tr>\n",
                            "    <tr>\n",
                            "      <th>109</th>\n",
                            "      <td>2021-08-06</td>\n",
                            "      <td>13.14</td>\n",
                            "      <td>13.21</td>\n",
                            "      <td>13.29</td>\n",
                            "      <td>12.97</td>\n",
                            "      <td>44368</td>\n",
                            "      <td>58101714.0</td>\n",
                            "      <td>2.42</td>\n",
                            "      <td>0.00</td>\n",
                            "      <td>0.00</td>\n",
                            "      <td>1.32</td>\n",
                            "    </tr>\n",
                            "  </tbody>\n",
                            "</table>\n",
                            "<p>110 rows × 11 columns</p>\n",
                            "</div>"
                        ]
                    },
                    "metadata": {},
                    "execution_count": 12
                }
            ],
            "metadata": {}
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "source": [],
            "outputs": [],
            "metadata": {}
        }
    ],
    "metadata": {
        "orig_nbformat": 4,
        "language_info": {
            "name": "python",
            "version": "3.9.6",
            "mimetype": "text/x-python",
            "codemirror_mode": {
                "name": "ipython",
                "version": 3
            },
            "pygments_lexer": "ipython3",
            "nbconvert_exporter": "python",
            "file_extension": ".py"
        },
        "kernelspec": {
            "name": "python3",
            "display_name": "Python 3.9.6 64-bit"
        },
        "interpreter": {
            "hash": "e4d85d63baa40a9854e1e91e14fde8d7f9b9a564a40f3bc91b58b47abf2bd79f"
        }
    },
    "nbformat": 4,
    "nbformat_minor": 2
}